package com.schematic.flixel.donquicoco
{
	import org.flixel.FlxG;
	import org.flixel.FlxSound;


public class Barrel extends BaseSprite	
{
	private var soundBarrel:FlxSound;
	
    //--------------------------------------------------------------------------
    //
    // Constructor
    //
    //--------------------------------------------------------------------------

    /**
     * Creates a new instance of this class.
     */
    public function Barrel(x:Number = 0, y:Number = 0)
    {
        super(x, y);
        loadGraphic(Skins.BARREL, true, false, 32, 32, true);
		horizontalSpeed = 100;
		soundBarrel = FlxG.play(Sounds.BARREL_DOWN, 0.3, false);
		
        addAnimation(
            BaseSprite.MOVE_LEFT,
            [8,7,6,5,4,3,2,1,0],
            frameRate,
            true
        );
        addAnimation(
            BaseSprite.MOVE_RIGHT,
            [0,1,2,3,4,5,6,7,8],
            frameRate,
            true
        );
    }


	
	override public function kill():void
	{
		soundBarrel.destroy();
		super.kill();
	}
	

}
}